3.1278 \(\int x \tan ^{-1}(x) \log (1+x^2) \, dx\)

Optimal. Leaf size=49 \[ -\frac{1}{2} x \log \left (x^2+1\right )-\frac{1}{2} x^2 \tan ^{-1}(x)+\frac{1}{2} \left (x^2+1\right ) \log \left (x^2+1\right ) \tan ^{-1}(x)+\frac{3 x}{2}-\frac{3}{2} \tan ^{-1}(x) \]

[Out]

(3*x)/2 - (3*ArcTan[x])/2 - (x^2*ArcTan[x])/2 - (x*Log[1 + x^2])/2 + ((1 + x^2)*ArcTan[x]*Log[1 + x^2])/2

________________________________________________________________________________________

Rubi [A]  time = 0.0499575, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 8, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.8, Rules used = {4852, 321, 203, 2454, 2389, 2295, 5019, 2448} \[ -\frac{1}{2} x \log \left (x^2+1\right )-\frac{1}{2} x^2 \tan ^{-1}(x)+\frac{1}{2} \left (x^2+1\right ) \log \left (x^2+1\right ) \tan ^{-1}(x)+\frac{3 x}{2}-\frac{3}{2} \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

Int[x*ArcTan[x]*Log[1 + x^2],x]

[Out]

(3*x)/2 - (3*ArcTan[x])/2 - (x^2*ArcTan[x])/2 - (x*Log[1 + x^2])/2 + ((1 + x^2)*ArcTan[x]*Log[1 + x^2])/2

Rule 4852

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*ArcTa
n[c*x])^p)/(d*(m + 1)), x] - Dist[(b*c*p)/(d*(m + 1)), Int[((d*x)^(m + 1)*(a + b*ArcTan[c*x])^(p - 1))/(1 + c^
2*x^2), x], x] /; FreeQ[{a, b, c, d, m}, x] && IGtQ[p, 0] && (EqQ[p, 1] || IntegerQ[m]) && NeQ[m, -1]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 2454

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))^(q_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[I
nt[x^(Simplify[(m + 1)/n] - 1)*(a + b*Log[c*(d + e*x)^p])^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, e, m, n, p,
 q}, x] && IntegerQ[Simplify[(m + 1)/n]] && (GtQ[(m + 1)/n, 0] || IGtQ[q, 0]) &&  !(EqQ[q, 1] && ILtQ[n, 0] &&
 IGtQ[m, 0])

Rule 2389

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 5019

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_.) + Log[(f_.) + (g_.)*(x_)^2]*(e_.))*(x_)^(m_.), x_Symbol] :> With
[{u = IntHide[x^m*(d + e*Log[f + g*x^2]), x]}, Dist[a + b*ArcTan[c*x], u, x] - Dist[b*c, Int[ExpandIntegrand[u
/(1 + c^2*x^2), x], x], x]] /; FreeQ[{a, b, c, d, e, f, g}, x] && IGtQ[(m + 1)/2, 0]

Rule 2448

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)], x_Symbol] :> Simp[x*Log[c*(d + e*x^n)^p], x] - Dist[e*n*p, Int[
x^n/(d + e*x^n), x], x] /; FreeQ[{c, d, e, n, p}, x]

Rubi steps

\begin{align*} \int x \tan ^{-1}(x) \log \left (1+x^2\right ) \, dx &=-\frac{1}{2} x^2 \tan ^{-1}(x)+\frac{1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\int \left (-\frac{x^2}{2 \left (1+x^2\right )}+\frac{1}{2} \log \left (1+x^2\right )\right ) \, dx\\ &=-\frac{1}{2} x^2 \tan ^{-1}(x)+\frac{1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )+\frac{1}{2} \int \frac{x^2}{1+x^2} \, dx-\frac{1}{2} \int \log \left (1+x^2\right ) \, dx\\ &=\frac{x}{2}-\frac{1}{2} x^2 \tan ^{-1}(x)-\frac{1}{2} x \log \left (1+x^2\right )+\frac{1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\frac{1}{2} \int \frac{1}{1+x^2} \, dx+\int \frac{x^2}{1+x^2} \, dx\\ &=\frac{3 x}{2}-\frac{1}{2} \tan ^{-1}(x)-\frac{1}{2} x^2 \tan ^{-1}(x)-\frac{1}{2} x \log \left (1+x^2\right )+\frac{1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )-\int \frac{1}{1+x^2} \, dx\\ &=\frac{3 x}{2}-\frac{3}{2} \tan ^{-1}(x)-\frac{1}{2} x^2 \tan ^{-1}(x)-\frac{1}{2} x \log \left (1+x^2\right )+\frac{1}{2} \left (1+x^2\right ) \tan ^{-1}(x) \log \left (1+x^2\right )\\ \end{align*}

Mathematica [A]  time = 0.0168273, size = 38, normalized size = 0.78 \[ \frac{1}{2} \left (x^2 \left (-\tan ^{-1}(x)\right )+\log \left (x^2+1\right ) \left (\left (x^2+1\right ) \tan ^{-1}(x)-x\right )+3 x-3 \tan ^{-1}(x)\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x*ArcTan[x]*Log[1 + x^2],x]

[Out]

(3*x - 3*ArcTan[x] - x^2*ArcTan[x] + (-x + (1 + x^2)*ArcTan[x])*Log[1 + x^2])/2

________________________________________________________________________________________

Maple [C]  time = 0.581, size = 2240, normalized size = 45.7 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*arctan(x)*ln(x^2+1),x)

[Out]

3/2*x+1/4*I*csgn(I*(1+I*x)/(x^2+1)^(1/2))^2*csgn(I*(1+I*x)^2/(x^2+1))*Pi*x-5/2*arctan(x)+(-I*arctan(x)+x*arcta
n(x)-1)*(x+I)*ln((1+I*x)/(x^2+1)^(1/2))-1/4*I*arctan(x)*csgn(I*(1+I*x)/(x^2+1)^(1/2))^2*csgn(I*(1+I*x)^2/(x^2+
1))*Pi+1/2*I*arctan(x)*csgn(I*(1+I*x)/(x^2+1)^(1/2))*csgn(I*(1+I*x)^2/(x^2+1))^2*Pi-1/2*I*arctan(x)*csgn(I*((1
+I*x)^2/(x^2+1)+1)^2)^2*csgn(I*((1+I*x)^2/(x^2+1)+1))*Pi+1/4*I*arctan(x)*csgn(I*((1+I*x)^2/(x^2+1)+1)^2)*csgn(
I*((1+I*x)^2/(x^2+1)+1))^2*Pi-1/4*I*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^2*csgn(I/((1+I*x)^2/(x^2
+1)+1)^2)*Pi*x-1/4*I*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^2*csgn(I*(1+I*x)^2/(x^2+1))*Pi*x+3/2*I-
1/2*I*csgn(I*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^2+1)/((1+I*x)^2/(x^2+1)+1)^2)
*csgn(I/((1+I*x)^2/(x^2+1)+1)^2)*csgn(I*(1+I*x)^2/(x^2+1))*Pi+1/4*I*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1
)+1)^2)*csgn(I/((1+I*x)^2/(x^2+1)+1)^2)*csgn(I*(1+I*x)^2/(x^2+1))*Pi*x+1/4*Pi*csgn(I*((1+I*x)^2/(x^2+1)+1)^2)^
3-1/4*Pi*csgn(I/((1+I*x)^2/(x^2+1)+1)^2)*csgn(I*(1+I*x)^2/(x^2+1))*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)
+1)^2)-1/4*Pi*csgn(I*(1+I*x)^2/(x^2+1)/((1+I*x)^2/(x^2+1)+1)^2)^3-1/4*Pi*csgn(I*(1+I*x)^2/(x^2+1))^3-arctan(x)
*ln((1+I*x)^2/(x^2+1)+1)+arctan(x)*ln(2)+ln((1+I*x)^2/(x^2+1)+1)*x

________________________________________________________________________________________

Maxima [A]  time = 1.89245, size = 53, normalized size = 1.08 \begin{align*} -\frac{1}{2} \,{\left (x^{2} -{\left (x^{2} + 1\right )} \log \left (x^{2} + 1\right ) + 1\right )} \arctan \left (x\right ) - \frac{1}{2} \, x \log \left (x^{2} + 1\right ) + \frac{3}{2} \, x - \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="maxima")

[Out]

-1/2*(x^2 - (x^2 + 1)*log(x^2 + 1) + 1)*arctan(x) - 1/2*x*log(x^2 + 1) + 3/2*x - arctan(x)

________________________________________________________________________________________

Fricas [A]  time = 1.40267, size = 107, normalized size = 2.18 \begin{align*} -\frac{1}{2} \,{\left (x^{2} + 3\right )} \arctan \left (x\right ) + \frac{1}{2} \,{\left ({\left (x^{2} + 1\right )} \arctan \left (x\right ) - x\right )} \log \left (x^{2} + 1\right ) + \frac{3}{2} \, x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="fricas")

[Out]

-1/2*(x^2 + 3)*arctan(x) + 1/2*((x^2 + 1)*arctan(x) - x)*log(x^2 + 1) + 3/2*x

________________________________________________________________________________________

Sympy [A]  time = 1.589, size = 56, normalized size = 1.14 \begin{align*} \frac{x^{2} \log{\left (x^{2} + 1 \right )} \operatorname{atan}{\left (x \right )}}{2} - \frac{x^{2} \operatorname{atan}{\left (x \right )}}{2} - \frac{x \log{\left (x^{2} + 1 \right )}}{2} + \frac{3 x}{2} + \frac{\log{\left (x^{2} + 1 \right )} \operatorname{atan}{\left (x \right )}}{2} - \frac{3 \operatorname{atan}{\left (x \right )}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*atan(x)*ln(x**2+1),x)

[Out]

x**2*log(x**2 + 1)*atan(x)/2 - x**2*atan(x)/2 - x*log(x**2 + 1)/2 + 3*x/2 + log(x**2 + 1)*atan(x)/2 - 3*atan(x
)/2

________________________________________________________________________________________

Giac [B]  time = 1.10753, size = 116, normalized size = 2.37 \begin{align*} \frac{1}{4} \, \pi x^{2} \log \left (x^{2} + 1\right ) \mathrm{sgn}\left (x\right ) - \frac{1}{2} \, x^{2} \arctan \left (\frac{1}{x}\right ) \log \left (x^{2} + 1\right ) - \frac{1}{4} \, \pi x^{2} \mathrm{sgn}\left (x\right ) + \frac{1}{2} \, x^{2} \arctan \left (\frac{1}{x}\right ) + \frac{1}{4} \, \pi \log \left (x^{2} + 1\right ) \mathrm{sgn}\left (x\right ) - \frac{1}{2} \, x \log \left (x^{2} + 1\right ) - \frac{1}{2} \, \arctan \left (\frac{1}{x}\right ) \log \left (x^{2} + 1\right ) + \frac{3}{2} \, x - \frac{3}{2} \, \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(x)*log(x^2+1),x, algorithm="giac")

[Out]

1/4*pi*x^2*log(x^2 + 1)*sgn(x) - 1/2*x^2*arctan(1/x)*log(x^2 + 1) - 1/4*pi*x^2*sgn(x) + 1/2*x^2*arctan(1/x) +
1/4*pi*log(x^2 + 1)*sgn(x) - 1/2*x*log(x^2 + 1) - 1/2*arctan(1/x)*log(x^2 + 1) + 3/2*x - 3/2*arctan(x)